<template>
  
  <div >
    
  <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column v-for="(item) in Object.keys(tableHeadData)" :key="item.bisheId"
      :label="tableHeadData[item]"
      width="180">
      <template slot-scope="scope">
        <i class="el-icon-time"></i>
        <span style="margin-left: 10px">{{  scope.row[item]  }}</span>
      </template>
    </el-table-column>
    
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button
          size="mini"
          @click="detail(scope.row)">详情</el-button>
      </template>
    </el-table-column>
  </el-table>
    
  
</div>
</template>

<script>
import axios from 'axios';



export default {
    data(){
        return{
            identity: 'student',
            studentId: '',
            //表头数据
            tableHeadData:{
                    bisheId: '毕设编号',
                    teacherId : '老师编号',
                    teacherName: '老师姓名',
                    univercity: '所属学院',
                    major: '所属专业',
                    bisheName: '毕设标题',
                    createtime: '课设上传时间',
                    islock: '最终学生编号/已双向选择'
                },

            //编辑数据
            message: [],

            labelPosition: 'right',
            formLabelAlign: {
              name: '',
              region: '',
              type: ''
            },
            tableData: [],
          currentPage: 1,
          pageSize: 10,
          

        }
    },
    computed:{
    },
    components:{
        
    },
    methods:{

        detail(row){
            console.log(row);
            this.$router.push({path: `/student/myBishe/DetailPage/${row.bisheId}`,query:{bisheData:row}})
        },
        
    },
    created(){
        this.studentId = JSON.parse(localStorage.getItem('data')).studentId
        console.log(this.studentId);
        // 请求tableData值
        axios.post(`/prod-api/xuanzhe/getStudentBishe`,{studentId:this.studentId})
                .then(response=>{
                    if(response.data.code === 0){
                        this.tableData.push(response.data.data) 
                        console.log(this.tableData);
                    }
                }).catch(error =>{
                    this.$router.push({path:"/error", params:{error:error}})
                })

    },
    
}

</script>

<style>
.my-paging{
  text-align: center;
  margin-top: 20px;
}
.my{
  margin-left: 0px !important;
}
</style>